<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>library</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab data type</center>
    <div align="right">Last update : 13/07/2005</div>
    <p>
      <b>library</b> -  library datatype description
  </p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl></dl>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    A library is a data type with type number 14. It contains a path-name
    and a set of names. It allows automatic loading of variables using the
    following algorithm:</p>
    <p>
    Suppose the Scilab user references the variable named <tt>
        <b>foo</b>
      </tt>.
    Scilab first looks if <tt>
        <b>foo</b>
      </tt> is the name of a primitive or of an
    already defined variable. If not, it looks for <tt>
        <b>foo</b>
      </tt> sequentially
    (the newest first) in all defined library .</p>
    <p>
    Suppose <tt>
        <b>foo</b>
      </tt> belongs to the set of names of the library <tt>
        <b>xlib</b>
      </tt>
    then Scilab tries to load the file
    &lt;xlib-path-name&gt;/foo.bin. &lt;xlib-path-name&gt;/foo.bin must have been
    created using the <tt>
        <b>save</b>
      </tt> function</p>
    <p>
    Library are often used for collection of functions, but they can also
    be used for any collection of scilab variables</p>
    <p>
    If a function is defined in more than one library, the default search
    algorithm loads thode contained in the newest. It possible to force
    the use of a specific library using dot notation:</p>
    <p>
      <tt>
        <b>xlib.foo</b>
      </tt> loads the variable <tt>
        <b>foo</b>
      </tt> contained in <tt>
        <b>xlib</b>
      </tt>.
    if <tt>
        <b>foo</b>
      </tt> is a function 
    and <tt>
        <b>xlib.foo(args)</b>
      </tt> executes the functions</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

// elemlib is a predefined library
elemlib //displays the contents of the library
A=rand(3,3);
cosm(A) //loads cosm and executes it

whos -name cosm // now cosm is a variable

elemlib.sinm //loads sinm from the library

elemlib.cosm(A) //reloads cosm and executes it
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="lib.htm">
        <tt>
          <b>lib</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../strings/string.htm">
        <tt>
          <b>string</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../fileio/load.htm">
        <tt>
          <b>load</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../fileio/save.htm">
        <tt>
          <b>save</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
